home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tp_dmx20.zip / READ.ME < prev    next >
Text File  |  1990-01-15  |  10KB  |  268 lines

  1.  
  2.                            DMX  Data Entry Matrix 2.0
  3.                             (C) 1990  Randolph Beck
  4.  
  5.  
  6.     DMX is a Turbo Pascal unit designed to manipulate data entry screens.
  7.     This is extremely flexible and powerful.  You can further enhance its
  8.     usefulness through creative use of objects-oriented programming.
  9.  
  10.     We have used this system for more than just data entry.  DMX can also
  11.     be used to create text listers, tables, smart help screens, and more.
  12.  
  13.     DMX requires Turbo Pascal 5.5 or above.
  14.  
  15.     ───────────────────────────────────────────────────────────────────────
  16.  
  17.     Trademark acknowledgements:
  18.                 Turbo Pascal is a trademark of Borland International, Inc.
  19.                 dBASE is a trademark of Ashton-Tate.
  20.  
  21.     ───────────────────────────────────────────────────────────────────────
  22.  
  23.     This is a shareware product and may be distributed and copied for free,
  24.     providing that no profit is made through such distribution.
  25.  
  26.     Users may register their copy by sending $12.  Registered users will
  27.     receive a diskette with the most recent version of the DMX TPU files;
  28.     associated program units; and documentation of its internal functions.
  29.  
  30.     The registered version will include full access to the many internal
  31.     procedures and functions which make this system work.
  32.  
  33.     Registered users can also receive fully documented source code for an
  34.     additional $35.
  35.  
  36.       Randolph Beck
  37.       DMX Registration
  38.       P.O. Box  560487
  39.       Orlando, FL
  40.       32856-0487
  41.  
  42.  
  43.     Business and government organizations are required to register in
  44.     order to continue to use this system.
  45.  
  46.     No run-time fee is required for compiled code.
  47.  
  48.     ───────────────────────────────────────────────────────────────────────
  49.  
  50.     Files included:
  51.  
  52.           READ.ME            This.
  53.  
  54.           DMX2.TPU           Main DMX unit
  55.           TVIDEO.OBJ         Required for compiling with DMX2.TPU
  56.           DMXFILE.PAS        Source code for the file-handling unit
  57.           DMXDFILE.PAS       Source code for the dBASE file-handling unit
  58.  
  59.           DMXAMPLE.PAS       Source code for the simple example
  60.           DBENTRY.PAS        Source code for the dBASE file demo
  61.  
  62.  
  63.     ───────────────────────────────────────────────────────────────────────
  64.  
  65.                           What Makes DMX So Easy to Use?
  66.  
  67.     The final appearance of these programs is usually very spreadsheet-like.
  68.     After deciding upon your record structures, you can pass this to the
  69.     DMX initialization procedure using a formatting string.  This string
  70.     will also determine the display format.
  71.  
  72.     Example:
  73.       A RECORD with a STRING [20], an INTEGER, and a REAL may use this format:
  74.         ' ____________________ | IIII | ($RRR,RRR.RR) '
  75.  
  76.  
  77.     The vertical bars ("|") delimiting the fields will be converted into
  78.     solid lines when displayed.
  79.  
  80.     The data type of each field is determined by the letters in the string.
  81.     There are provisions for most data types, in many different formats.
  82.  
  83.     Programmers only need to alter this one formatting string when changing
  84.     their data structure.
  85.  
  86.  
  87.     ───────────────────────────────────────────────────────────────────────
  88.  
  89.                                 Getting Started
  90.  
  91.     The object is initialized with a formatting string, and another string
  92.     which is used for an optional title.
  93.     Also required are five word-types:
  94.        the number of lines above the data entry area;
  95.        the number of lines below the data entry area;
  96.        border color (used only for field separators);
  97.        text color;
  98.        and the color attributes of the hilighted field.
  99.  
  100.     Example:
  101.       DMXwindow.Init (' Name                    ref      balance    ',
  102.                       ' ____________________ | IIII | ($RRR,RRR.RR) ',
  103.                       2,0, Cyan,LightCyan,$3F);
  104.  
  105.  
  106.     ───────────────────────────────────────────────────────────────────────
  107.  
  108.                            Opening the Data Screen
  109.  
  110.     DMX is window-sensitive.  Your own program can do the WINDOW procedure
  111.     to change the window position.  (A separate border procedure is included
  112.     in this package for creating borders.)
  113.  
  114.     Use the OpenBuffer procedure to set up the screen.  This requires two
  115.     parameters:  The actual data buffer and the buffer size (in bytes).
  116.  
  117.     The structure of the data in the buffer must be the same as that which
  118.     was specified by the formatting string in the INIT procedure.
  119.     (There are advanced techniques which provide exceptions to most of the
  120.     rules; refer to the AdjustRecSize procedure in the DMXdFILE.PAS example.)
  121.  
  122.     Example:
  123.       DMXwindow.OpenBuffer (DataArray, sizeof (DataArray));
  124.  
  125.  
  126.     ───────────────────────────────────────────────────────────────────────
  127.  
  128.                                 Editing the Data
  129.  
  130.     The EditData procedure will take care of your data editing chores.
  131.     The parameters required are the data buffer (same as in the OpenBuffer
  132.     procedure) and keyboard control information:
  133.        Key and Ext are two char types for returning the last key pressed.
  134.        (If the last key was an extended character, the Key will be #0 and
  135.        the extended code will be returned in Ext.)
  136.        KeySet and ExtSet represents the set of characters that will force
  137.        DMX to exit.
  138.  
  139.     Example:
  140.       DMXwindow.EditData (DataArray, Key,ext, [Esc],[F1,F10]);
  141.  
  142.  
  143.     ───────────────────────────────────────────────────────────────────────
  144.  
  145.                             File-Handling Procedures
  146.  
  147.     Loading and saving data is not directly a function of DMX.
  148.     But this a necessity so often that Dwindow, a descendant object of
  149.     DMXwindow, was written to do simple file-handling chores.
  150.  
  151.     It contains two procedures:
  152.  
  153.       Dwindow.LoadDataBlock (DataArray, sizeof (DataArray), F);
  154.  
  155.       Dwindow.SaveDataBlock (DataArray, F);
  156.  
  157.  
  158.     The file variable F must have been previously ASSIGNed.
  159.  
  160.  
  161.     ───────────────────────────────────────────────────────────────────────
  162.  
  163.                                 A Simple Example
  164.  
  165.     This is a very simple example.  It does not provide a fancy border,
  166.     nor does it include a facility to save the data.  It is meant only
  167.     to show how easily a data entry screen can be created.
  168.  
  169.  
  170.     Program DEMO;
  171.     uses Dos,Crt,DMX2;
  172.     type DataRec    = record
  173.                         S :string [20];  I :integer;  R :real;
  174.                       end;
  175.     var  Key,ext    : char;
  176.          DataArray  : array [0..99] of DataRec;
  177.          DMXa       : Dwindow;
  178.     Begin
  179.       ClrScr;
  180.       Window (18,2,69,22);
  181.       FillChar (DataArray, sizeof (DataArray), 0);
  182.  
  183.       DMXa.Init (' Name                    ref      balance    ',
  184.                  ' ____________________ | IIII | ($RRR,RRR.RR) ',
  185.                   2,1, Cyan,LightCyan,$3F);
  186.  
  187.       DMXa.OpenBuffer (DataArray, sizeof (DataArray));
  188.  
  189.       DMXa.EditData (DataArray, Key,ext, [Esc],[F1,F10]);
  190.  
  191.       ClrScr;
  192.     End.
  193.  
  194.  
  195.     ───────────────────────────────────────────────────────────────────────
  196.  
  197.                         How Can I Make DMX More Powerful?
  198.                               Advanced Programming
  199.  
  200.     Object-oriented programming is what makes DMX powerful.  So far, we have
  201.     only scratched the surface.
  202.  
  203.     DMX allows Pascal programmers to quickly create a data entry screen.
  204.     Object-oriented programming allows programmers to change DMX itself.
  205.  
  206.  
  207.     For instance:  DMX, by itself, only concerns itself with data entry.
  208.     It does not display the current record number in any particular place.
  209.     However, there are several virtual procedures in this object which have
  210.     been reserved for specialized use.
  211.  
  212.     Programmers can create a descendant object with a procedure called:
  213.     SetUpRecord.  This procedure is used internally before editing each
  214.     record -- and originally did nothing.  A descendant for SetUpRecord
  215.     can display the current record number whereever the programmer decides.
  216.  
  217.  
  218.     Another example:  One apparent drawback to DMX is that it requires the
  219.     entire database to be loaded into an array.  But this can also be
  220.     circumvented by using another virtual method.  The example program
  221.     DBENTRY.PAS uses this method.
  222.  
  223.     Everytime DMX accesses a record, the location is provided by the DataAt
  224.     function.  This function is given a record number to calculates the
  225.     memory address in the data array.
  226.  
  227.     A descendant for the DataAt function can be written which reads the
  228.     record from a file, and returns a pointer to where it is is stored.
  229.  
  230.  
  231.     Descendant objects can also be written to remove a feature from DMX.
  232.     The procedure ZeroizeRecord (var RecordData ) is called whenever the
  233.     user presses ^Y.
  234.     A descendant can be written where ZeroizeRecord would do nothing.
  235.  
  236.  
  237.     ───────────────────────────────────────────────────────────────────────
  238.  
  239.                              Reserved Code Characters
  240.  
  241.     So far, we have only edited strings, integers, and reals.  DMX can be
  242.     used for even more data types in several different formats:
  243.  
  244.                 ^ = uppercase string field
  245.                 _ = string field
  246.                 c = character field  (or character array)
  247.                 C = uppercase character field
  248.                 # = numeric string field  (for entering phone numbers)
  249.                 N = numeric character field (for dBASE-type fields)
  250.                 0 = numeric character field (for entering phone numbers)
  251.                 B = byte field
  252.                 W = word field
  253.                 I = integer field
  254.                 L = longint field
  255.                 R = real number field
  256.                 ~ = boolean value field
  257.  
  258.     Note: Lowercase code indicates positive values only (for numbers).
  259.  
  260.  
  261.     DMX requires these restrictions for the format string:
  262.  
  263.         1.  Do not use more than one type of format character in each field.
  264.         2.  Do not mix the case of format characters within each field.
  265.         3.  When using 'N' fields:  A left parenthesis counts as one digit.
  266.  
  267.  
  268.